package com.thread.callable;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @Author milian
 * @Date 2021/7/28 0028 15:17
 */
public class test {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        MyCallable callable = new MyCallable();
        FutureTask<String> futureTask = new FutureTask<>(callable);
        Thread t1 = new Thread(futureTask);
        Thread t2 = new Thread(futureTask);
        t1.setPriority(10);
        t2.setPriority(1);
        t1.start();
        t2.start();
        System.out.println(futureTask.get());
        System.out.println(t1.getPriority());
        System.out.println(t2.getPriority());
    }
}
